<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, user-scalable=no">
  <meta name="description" content="API docs for the TOTP constructor from the Class TOTP class from the dart_otp library, for the Dart programming language.">
  <title>TOTP constructor - TOTP class - dart_otp library - Dart API</title>
  <!-- required because all the links are pseudo-absolute -->
  <base href="../..">

  <link href="https://fonts.googleapis.com/css?family=Source+Code+Pro:500,400i,400,300|Source+Sans+Pro:400,300,700" rel="stylesheet">
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  <link rel="stylesheet" href="static-assets/github.css">
  <link rel="stylesheet" href="static-assets/styles.css">
  <link rel="icon" href="static-assets/favicon.png">
  
</head>

<body>

<div id="overlay-under-drawer"></div>

<header id="title">
  <button id="sidenav-left-toggle" type="button">&nbsp;</button>
  <ol class="breadcrumbs gt-separated dark hidden-xs">
    <li><a href="index.html">dart_otp</a></li>
    <li><a href="dart_otp/dart_otp-library.html">dart_otp</a></li>
    <li><a href="dart_otp/TOTP-class.html">TOTP</a></li>
    <li class="self-crumb">TOTP constructor</li>
  </ol>
  <div class="self-name">TOTP</div>
  <form class="search navbar-right" role="search">
    <input type="text" id="search-box" autocomplete="off" disabled class="form-control typeahead" placeholder="Loading search...">
  </form>
</header>

<main>

  <div id="dartdoc-sidebar-left" class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left">
    <header id="header-search-sidebar" class="hidden-l">
      <form class="search-sidebar" role="search">
        <input type="text" id="search-sidebar" autocomplete="off" disabled class="form-control typeahead" placeholder="Loading search...">
      </form>
    </header>
    
    <ol class="breadcrumbs gt-separated dark hidden-l" id="sidebar-nav">
      <li><a href="index.html">dart_otp</a></li>
      <li><a href="dart_otp/dart_otp-library.html">dart_otp</a></li>
      <li><a href="dart_otp/TOTP-class.html">TOTP</a></li>
      <li class="self-crumb">TOTP constructor</li>
    </ol>
    
    <h5>TOTP class</h5>
    <ol>
      <li class="section-title"><a href="dart_otp/TOTP-class.html#constructors">Constructors</a></li>
      <li><a href="dart_otp/TOTP/TOTP.html">TOTP</a></li>
    
      <li class="section-title">
        <a href="dart_otp/TOTP-class.html#instance-properties">Properties</a>
      </li>
      <li><a href="dart_otp/TOTP/extraUrlProperties.html">extraUrlProperties</a></li>
      <li><a href="dart_otp/TOTP/interval.html">interval</a></li>
      <li><a href="dart_otp/TOTP/type.html">type</a></li>
      <li class="inherited"><a href="dart_otp/TOTP/algorithm.html">algorithm</a></li>
      <li class="inherited"><a href="dart_otp/TOTP/digits.html">digits</a></li>
      <li class="inherited"><a href="dart_otp/TOTP/hashCode.html">hashCode</a></li>
      <li class="inherited"><a href="dart_otp/TOTP/runtimeType.html">runtimeType</a></li>
      <li class="inherited"><a href="dart_otp/TOTP/secret.html">secret</a></li>
    
      <li class="section-title"><a href="dart_otp/TOTP-class.html#instance-methods">Methods</a></li>
      <li><a href="dart_otp/TOTP/now.html">now</a></li>
      <li><a href="dart_otp/TOTP/value.html">value</a></li>
      <li><a href="dart_otp/TOTP/verify.html">verify</a></li>
      <li class="inherited"><a href="dart_otp/TOTP/generateOTP.html">generateOTP</a></li>
      <li class="inherited"><a href="dart_otp/TOTP/generateUrl.html">generateUrl</a></li>
      <li class="inherited"><a href="dart_otp/TOTP/noSuchMethod.html">noSuchMethod</a></li>
      <li class="inherited"><a href="dart_otp/TOTP/toString.html">toString</a></li>
    
      <li class="section-title inherited"><a href="dart_otp/TOTP-class.html#operators">Operators</a></li>
      <li class="inherited"><a href="dart_otp/TOTP/operator_equals.html">operator ==</a></li>
    
    
    
    </ol>
  </div><!--/.sidebar-offcanvas-left-->

  <div id="dartdoc-main-content" class="col-xs-12 col-sm-9 col-md-8 main-content">
      <div><h1><span class="kind-constructor">TOTP</span> constructor</h1></div>

    <section class="multi-line-signature">
      
      <span class="name ">TOTP</span>(<wbr>{<span class="parameter" id="-param-secret"><span class="type-annotation">String</span> <span class="parameter-name">secret</span>, </span> <span class="parameter" id="-param-digits"><span class="type-annotation">int</span> <span class="parameter-name">digits</span>: <span class="default-value">6</span>, </span> <span class="parameter" id="-param-interval"><span class="type-annotation">int</span> <span class="parameter-name">interval</span>: <span class="default-value">30</span>, </span> <span class="parameter" id="-param-algorithm"><span class="type-annotation"><a href="dart_otp/OTPAlgorithm-class.html">OTPAlgorithm</a></span> <span class="parameter-name">algorithm</span>: <span class="default-value">OTPAlgorithm.SHA1</span></span> })
    </section>

    <section class="desc markdown">
      <p>This constructor will create an TOTP instance.</p>
<p>All parameters are mandatory however <code>interval</code>,
<code>digits</code> and <code>algorithm</code> have a default values, so can be ignored.</p>
<p>Will throw an exception if the line above isn't satisfied.</p>
    </section>
    
    <section class="summary source-code" id="source">
      <h2><span>Implementation</span></h2>
      <pre class="language-dart"><code class="language-dart">TOTP(
    {String secret,
    int digits = 6,
    int interval = 30,
    OTPAlgorithm algorithm = OTPAlgorithm.SHA1})
    : super(secret: secret, digits: digits, algorithm: algorithm) {
  this.interval = interval;
}</code></pre>
    </section>

  </div> <!-- /.main-content -->

  <div id="dartdoc-sidebar-right" class="col-xs-6 col-sm-6 col-md-2 sidebar sidebar-offcanvas-right">
  </div><!--/.sidebar-offcanvas-->

</main>

<footer>
  <span class="no-break">
    dart_otp 1.3.0
  </span>

  
</footer>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="static-assets/typeahead.bundle.min.js"></script>
<script src="static-assets/highlight.pack.js"></script>
<script src="static-assets/URI.js"></script>
<script src="static-assets/script.js"></script>


</body>

</html>
